#ifndef PROPERTYINSPECTORUPDATER_H
#define PROPERTYINSPECTORUPDATER_H

#include <QObject>

#include <QString>
#include "CProperty.h"
#include "CPropertyItem.h"
#include "CGroupItem.h"
#include "CPropertyEditor.h"

class PropertyInspectorUpdater : public QObject
{
    Q_OBJECT
public:
    struct PropertiesGroups
    {
        CGroupItem * advanced;
        CGroupItem * common;
        CGroupItem * dimentions;
    };
    typedef csmodel::CProperties::traits_type  Traits;
    typedef CPropertyEditor                  Inspector;
    typedef CPropertyItem * (PropertyInspectorUpdater::*PropertyCreator)( const QString & name ) const;
    typedef std::map< QString, PropertyCreator > CreatorsMap;
    explicit PropertyInspectorUpdater( Inspector *_propInsp, QObject *parent = 0 );
    void Update( csmodel::CProperties & props ) const;
protected:
    void ProcessProperty( const Traits & traits, const QString & name ) const;
    CPropertyItem * GetProperty( const QString & name ) const;
    CPropertyItem * CreateProperty( const QString & name ) const;

    CPropertyItem * CreateBoolProperty( const QString & name ) const;

    CPropertyItem * CreateGUIDProperty( const QString & name ) const;
    CPropertyItem * CreateIdProperty( const QString & name ) const;
    CPropertyItem * CreateNameProperty( const QString & name ) const;
    CPropertyItem * CreateXProperty( const QString & name ) const;
    CPropertyItem * CreateYProperty( const QString & name ) const;
    CPropertyItem * CreateWidthProperty( const QString & name ) const;
    CPropertyItem * CreateHeightProperty( const QString & name ) const;

    void GetPropertiesGroups();

private:
    Inspector        *propInsp;
    CreatorsMap       creatorsMap;
    PropertiesGroups  groups;
    
signals:
    
public slots:

    
};

#endif // PROPERTYINSPECTORUPDATER_H
